 /**********************
 * Matthew Tanner
 * tannerm.onid.orst.edu
 * CS362
 * Assignment #3 cardtest2.c
 * Tests the zzzvilliagecardplay function in dominion.c
 ***********************/

#include "dominion.h"
#include "dominion_helpers.h"
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include "rngs.h"
#include "tests.h"


void cardtest2() {

	struct gameState g;
	int players = 2;
	int k[10] = {adventurer, council_room, sea_hag, gardens, mine, remodel, smithy, village, baron, great_hall};
	int seed = 100;
	int res, player;
	int bonus = 0;

	//initialize game, check initial # of cards for reference
	res = initializeGame(players, k, seed, &g);
	player = whoseTurn(&g);

	printf("Testing zzzvilliageplaycard:\n");
	printf("Adding village card to hand\n");

	// add village card, check # of cards and actions for reference
	res = gainCard(village, &g, 2, player);

	printf("Expect 6 cards in hand, actual: %d\n", numHandCards(&g));
	printf("Expect 1 action remaining, actual: %d\n", g.numActions);

	printf("Playing village card\n");

	// play village card, check that han still has 6 cards (discard + 1 new)
	// and actions are increased by 2.
	res = cardEffect(village, 0, 0, 0, &g, 5, &bonus);

	printf("Expect 6 cards in hand, actual: %d\n", numHandCards(&g));
	assert(numHandCards(&g) == 6);
	printf("Expect 3 actions remaining, actual: %d\n", g.numActions);
	assert(g.numActions == 3);
}